Ext.define('AM.view.panel.GraficPanel' ,{
    extend: 'Ext.form.Panel',
    alias : 'widget.grafic',
    id: 'grafic',
    layout: 'fit',
    
    initComponent: function() {
    	this.items= [{
                 xtype: 'chart',
    //    	                 id:'chart',
                 store: 'StoreGrafic',
                 shadow: true,
                 insetPadding: 5,
                 legend: {
                     position: 'right'
                 },
                 axes: [{
                     type: 'Numeric',
                     minimum: 0,
                     position: 'left',
                     fields: ['Cheltuieli', 'Venituri'],
                     minorTickSteps: 1,
                     grid: true,
                     label: {
                         renderer: Ext.util.Format.numberRenderer('0,0'),
                         font: '10px Arial'
                     }
                 }, {
                     type: 'Category',
                     position: 'bottom',
                     fields: ['lun'],
                     grid:true,
                     label: {
                         font: '11px Arial',
                         renderer: function(name) {
                             return name.substr(0, 3);
                         }
                     }
                 }],
                 series: [{
                     type: 'line',
                     highlight: {
                         size: 7,
                         radius: 7
                     },
                     axis: 'left',
                     xField: 'lun',
                     yField: 'Cheltuieli',
                     markerConfig: {
                         type: 'cross',
                         size: 4,
                         radius: 4,
                         'stroke-width': 0
                     }, tips: {
                         trackMouse: true,
                         width: 160,
                         height: 20,
                         renderer: function(storeItem, item) {
                             this.setTitle(storeItem.get('Cheltuieli') + ' Euro cheltuiţi în ' + storeItem.get('lun').substr(0, 3));
                         }
                     }
                 }, {
                     type: 'line',
                     highlight: {
                         size: 7,
                         radius: 7
                     },
                     axis: 'left',
                     smooth: true,
                     xField: 'lun',
                     yField: 'Venituri',
                     tips: {
                         trackMouse: true,
                         width: 180,
                         height: 20,
                         renderer: function(storeItem, item) {
                             this.setTitle(storeItem.get('Venituri') + ' Euro câştigaţi în ' + storeItem.get('lun').substr(0, 3));
                         }
                     },
                     markerConfig: {
                         type: 'circle',
                         size: 4,
                         radius: 4,
                         'stroke-width': 0
                     }
                 }]
             }
        ],
        this.callParent();
    }
});